import { _decorator, Component, instantiate, UITransform } from 'cc';
import { ResManager } from '../res/ResManager';
import { G_VIEW_SIZE } from '../../Boost';
const { ccclass, property } = _decorator;


export class UIManager{

    private static _instance: UIManager = null!;

    static getInstance(){
        if (this._instance === null) {
            this._instance = new UIManager();
        }
        return this._instance;
    }

    private constructor(){

    }

    open(uiClass:any){
        ResManager.getInstance().loadPrefab('Match3BN','Match3UI',prefab => {
            let match3Node = instantiate(prefab);
            this.node.addChild(match3Node);
            match3Node.getComponent(UITransform).setContentSize(G_VIEW_SIZE.clone());

        })
    }
}
